package Logica;

import DAO.SurgeryDao;

import java.util.ArrayList;

public class Surgery {
  //Primary Key 
  private int surgeryN;
  //Attributes
  SurgeryDao surgeryDao = new SurgeryDao();
  private int appoinmentNumber;
  private int room;
  private Staff personalC; 
  private ArrayList<Staff> miembros=new ArrayList<Staff>();
  
  //Appoinment cita;
  public Surgery() {
  }

  public Surgery( int appoinmentnumber, int room, int surgeryN,
                 ArrayList<Staff> miembros) {
    super();
 
    this.appoinmentNumber = appoinmentnumber;
    this.room = room;
    this.surgeryN = surgeryN;
    this.miembros = miembros;
  }

  public void setAppoinmentnumber(int appoinmentnumber) {
    this.appoinmentNumber = appoinmentnumber;
  }

  public int getAppoinmentnumber() {
    return appoinmentNumber;
  }

  public void setRoom(int room) {
    this.room = room;
  }

  public int getRoom() {
    return room;
  }

  public void setSurgeryN(int surgeryN) {
    this.surgeryN = surgeryN;
  }

  public int getSurgeryN() {
    return surgeryN;
  }

  public void setPersonalC(Staff personalC) {
    this.personalC = personalC;
  }

  public Staff getPersonalC() {
    return personalC;
  }

  public void setMiembros(ArrayList<Staff> miembros) {
    this.miembros = miembros;
  }

  public ArrayList<Staff> getMiembros() {
    return miembros;
  }
  
  public Object[][] DarDatosGuiCirugia() {
    Object[][] datos = new Object[100][100];
    datos = surgeryDao.DatosCirugiaTabla();
    return datos;
  }
  
  
  public boolean creaSurgey(String sala, String staffn,
                         String appointmentn)
  {
    return surgeryDao.creaSurgey(sala, Integer.valueOf(staffn), Integer.valueOf(appointmentn));
  }
  
  
  public boolean EliminarCirugia(String numSurgery){
    return surgeryDao.eliminarSurgery(Integer.valueOf(numSurgery));   
    
  }
  
  public void modificar(String surgeryNumber, String sala, String staffn,
                        String appointmentn)
  {
    surgeryDao.modificaSurgeryAppointmentNumber(Integer.valueOf(surgeryNumber), Integer.valueOf(appointmentn));
    surgeryDao.modificaSurgerySala(Integer.valueOf(surgeryNumber), sala);
    surgeryDao.modificaSurgeryStaffNumber(Integer.valueOf(surgeryNumber), Integer.valueOf(staffn));
  }
}
